<?php


class fetchData {


	public function getGroupForumsCount($id){
		$this->id = $id;
		$sql = "SELECT * FROM `forum` WHERE `group_id` = '$id'";
		$result = mysql_query($sql)or die (mysql_error());

		$count = mysql_num_rows($result);
		//	while($f = mysql_fetch_array($result)){
		//		$forums[] = $f;
		//	}

		return $count;
	}

	public function getStudentForumsCount($id){
		$this->id = $id;
		$sql = "SELECT * FROM `forum` WHERE `author` = '$id'";
		$result = mysql_query($sql)or die (mysql_error());
		$count = mysql_num_rows($result);

		return $count;
	}

	public function getGroupCommitsCount($id){
		$this->id = $id;
		$sql = "SELECT * FROM `svn_commits` WHERE `group_id` = '$id'";
		$result = mysql_query($sql)or die (mysql_error());
		$count = mysql_num_rows($result);

		return $count;
	}

	public function getStudentCommitsCount($id){
		$this->id = $id;
		$sql = "SELECT * FROM `svn_commits` WHERE `author` = '$id'";
		$result = mysql_query($sql)or die (mysql_error());
		$count = mysql_num_rows($result);

		return $count;
	}

	public function getGroupDownloadCount($id){
		$this->id = $id;
		$sql = "SELECT * FROM `downloads` WHERE `group_id` = '$id'";
		$result = mysql_query($sql)or die (mysql_error());
		$count = mysql_num_rows($result);

		return $count;
	}

	public function getStudentDownloadsCount($id){
		$this->id = $id;
		$sql = "SELECT * FROM `downloads` WHERE `author` = '$id'";
		$result = mysql_query($sql)or die (mysql_error());
		$count = mysql_num_rows($result);

		return $count;
	}

	public function getGroupWikiCount($id){
		$this->id = $id;
		$sql = "SELECT * FROM `wiki` WHERE `group_id` = '$id'";
		$result = mysql_query($sql)or die (mysql_error());
		$count = mysql_num_rows($result);

		return $count;
	}

	public function getStudentWikiCount($id){
		$this->id = $id;
		$sql = "SELECT * FROM `wiki` WHERE `author` = '$id'";
		$result = mysql_query($sql)or die (mysql_error());
		$count = mysql_num_rows($result);

		return $count;
	}


}
?>